<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
body {
	background-color: black;
	margin: 0; /* 去掉自带外边距 */
}

img {
	position: absolute;
}
</style>
</head>
<body>
  <script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
  <script type="text/javascript">
			//开启添加雪花的定时器
			setInterval(function() {
				//创建雪花图片
				var img=$("<img src='snow.png'>");
				//设置随机雪花大小 40-80
				var size =parseInt(Math.random()*21)+20;
				//获取窗口宽度
				var w=$(window).width();
				//得到一个随机的left值
				var left=parseInt(Math.random()*(w-size));
				img.css({"width":size+"px","left":left+"px"});
				$("body").append(img);
				var h=$(window).height();
				//让雪花图片移动到屏幕下方20-40 2000-4000
				img.animate({"top":(h-size)+"px","left":left+200+"px"},size*100).fadeOut(1000,function(){
					img.remove();
				});
				},10);
		</script>
</body>
</html>












